<?php
include_once('../fm/comm.php');
include_once('../comm.php');
$myt = new thunder();

$pid = isset($_REQUEST['pid'])?$_REQUEST['pid']:0;

$sql = "select * from ".$_table_goods_source." where goods_id =".$pid." ";
$data = $myt->getAll($sql);
//echo var_dump($sql);
$pic = NewMagickWand();
$info = '';
foreach($data as $d){
    
  MagickReadImage ( $pic, '../'.$d['img_original'] );
	$h = MagickGetImageHeight($pic);
	$w = MagickGetImageWidth($pic);
	
	$info .= "<info>
			<img_id>".$d['img_id']."</img_id>
			<goods_id>".$d['goods_id']."</goods_id>
			<img_url>../".$d['img_url']."</img_url>
			<img_desc>".$d['img_desc']."</img_desc>
			<thumb_url>../".$d['thumb_url']."</thumb_url>
			<img_original>../".$d['img_original']."</img_original>
			<width>".$w."</width>
			<height>".$h."</height>
			</info>";
		
	/*$gallery .= "<image img_id='".$d['img_id']."' 
	                    goods_id='".$d['goods_id']."' 
	                    img_url='../../".$d['img_url']."' 
	                    img_desc='".$d['img_desc']."' 
	                    thumb_url='../../".$d['thumb_url']."' 
	                    img_original='../../".$d['img_original']."' 
	             />";		*/
}
$result = "<gallery>".$info."</gallery>";
echo $result;
?>